#!/usr/bin/env bash

#go get -u github.com/gin-gonic/gin
#go mod init hk-video-manager
#go mod tidy
#go mod vendor


mkdir -p bin/
if [ -f "bin/hk-video-manager" ]; then
    rm -f bin/hk-video-manager
fi

go build -mod=vendor -v -o bin/hk-video-manager cmd/video/main.go
if [ $? -ne 0 ]; then
    echo "build video-manager failed"
    exit 1
fi

echo "build video-manager is ok"
./bin/hk-video-manager




# mkdir -p bin/amd64/
# if [ -f "bin/amd64/hk-video-manager" ]; then
#     rm -f bin/amd64/hk-video-manager
# fi

# export GOOS=linux
# export GOARCH=amd64
# export CGO_ENABLED=0

# go build -mod=vendor -v -o bin/amd64/hk-video-manager cmd/video/main.go
# if [ $? -ne 0 ]; then
#     echo "build video-manager failed"
#     exit 1
# fi

# echo "build video-manager is ok"
